package net.bplaced.streetfighter.lib.model;

import net.bplaced.streetfighter.lib.utils.MainMenuItemType;
import android.app.Fragment;
import android.content.Intent;

/**
 * Business entity of a main menu entry. Used to be displayed in the main menu.
 * 
 * @author Sebastian Hoffmann <bo.hoffi@googlemail.com>
 */
public class MainMenuEntry {

    /**
     * Intent to start when tapping on the menu entry.
     */
    private Intent entryIntent;

    /**
     * Fragment to show when tapping on the menu entry.
     */
    private Fragment entryFragment;

    /**
     * Type of the menu entry.
     */
    private MainMenuItemType type;

    /**
     * Id of the drawable connected to the menu entry.
     */
    private int drawableId;

    /**
     * Caption of the menu entry.
     */
    private String entryCaption;

    /**
     * Flag to indicate whether the menu entry is active or not.
     */
    private boolean isActive;

    public MainMenuEntry(final String info, final Intent entryIntent, final Fragment entryFragment,
            final MainMenuItemType type, final int drawableId, final boolean isActive) {

        this.setEntryCaption(info);
        this.setEntryIntent(entryIntent);
        this.setEntryFragment(entryFragment);
        this.setItemType(type);
        this.setDrawableId(drawableId);
        this.setIsActive(isActive);
    }

    public MainMenuEntry(final String info, final Intent entryIntent, final MainMenuItemType type,
            final int drawableId, final boolean isActive) {

        this.setEntryCaption(info);
        this.setEntryIntent(entryIntent);
        this.setItemType(type);
        this.setDrawableId(drawableId);
        this.setIsActive(isActive);
    }

    public int getDrawableId() {

        return this.drawableId;
    }

    public String getEntryCaption() {

        return this.entryCaption;
    }

    /**
     * @return the entryFragment
     */
    public Fragment getEntryFragment() {

        return this.entryFragment;
    }

    /**
     * Gets the intent of the menu entry.
     * 
     * @return Intent
     */
    public Intent getEntryIntent() {

        return this.entryIntent;
    }

    public boolean getIsActive() {

        return this.isActive;
    }

    public MainMenuItemType getItemType() {

        return this.type;
    }

    public void setDrawableId(int drawableId) {

        this.drawableId = drawableId;
    }

    public void setEntryCaption(String entryInfo) {

        this.entryCaption = entryInfo;
    }

    /**
     * @param entryFragment
     *            the entryFragment to set
     */
    public void setEntryFragment(Fragment entryFragment) {

        this.entryFragment = entryFragment;
    }

    /**
     * Sets the intent of the menu entry.
     * 
     * @param entryIntent
     *            Intent for the entry
     */
    public void setEntryIntent(Intent entryIntent) {

        this.entryIntent = entryIntent;
    }

    public void setIsActive(boolean isActive) {

        this.isActive = isActive;
    }

    public void setItemType(MainMenuItemType type) {

        this.type = type;
    }
}